/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package persistencia;

import java.io.Serializable;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.transaction.UserTransaction;

/**
 *
 * @author Diego
 */
public class TicketJpaController implements Serializable  {
    
    private UserTransaction utx = null;
    private EntityManagerFactory emf = null;
    
    public TicketJpaController(UserTransaction utx, EntityManagerFactory emf) {
        this.utx = utx;
        this.emf = emf;
    }

    public TicketJpaController() {
        emf = Persistence.createEntityManagerFactory("entradasJpaPU");
    }
    
    public EntityManager getEntityManager() {
        return emf.createEntityManager();
    }
    
}
